#ifndef _MODEL_BASE_H_
#define _MODEL_BASE_H_

#include <onnxruntime_cxx_api.h>
#include <opencv2/opencv.hpp>
#include "cpu_provider_factory.h"

class ModelBase
{
public:
    ModelBase();
    virtual ~ModelBase();

public:
    virtual bool LoadModel(const std::string &onnx_env_name, const std::string &onnx_path);

    float LetterBox(const cv::Mat &input_mat, cv::Mat &output_mat,
                    std::vector<int> &padV,
                    const cv::Size &new_shape,
                    const cv::Scalar &color,
                    bool scale_up);

protected:
    virtual void PrintModelInfo(Ort::Session &session);

protected:
    // 创建会话
    Ort::Env m_env;
    std::unique_ptr<Ort::Session> m_session;
};

#endif